package com.kun.portal.webframe.controller;
import com.kun.portal.webframe.dao.FlightTypeInfoDao;
import com.kun.portal.webframe.po.FlightTypeInfoPo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpSession;
import java.util.List;
/**
 * Created by Administrator on 2018/5/8.
 */
@Controller
//
@RequestMapping({"/api/flightTypeInfo"})
public class FligntTypeInfoController  {
    private static final Logger LOG = LoggerFactory.getLogger(FwUserController.class);
    @Autowired
    private FlightTypeInfoDao flightTypeInfoDao;

    @RequestMapping(
            value = {"/queryFlightTypeInfo"},
            method = {RequestMethod.GET},
            produces = {"application/json"}
    )
    @ResponseBody
    public List<FlightTypeInfoPo> queryFlightTypeInfo() {
        return flightTypeInfoDao.findAll();
    }


    @RequestMapping(
            value = {"/saveFlightTypeInfo"},
            method = {RequestMethod.POST},
            produces = {"application/json"}
    )
    @ResponseBody
    public FlightTypeInfoPo saveFlightTypeInfo(@RequestBody FlightTypeInfoPo flightInfoPo, HttpSession session) {
        return flightTypeInfoDao.save(flightInfoPo);
    }
    @RequestMapping(
            value = {"/deleteFlightTypeInfo"},
            method = {RequestMethod.POST},
            produces = {"application/json"}
    )
    @ResponseBody
    public void deleteFlightTypeInfo(@RequestBody  FlightTypeInfoPo flightInfoPo, HttpSession session) {
        flightTypeInfoDao.delete(flightInfoPo);
    }
}

